#ifndef WebSocketService_WSProtocol_SqlDb_H
#define WebSocketService_WSProtocol_SqlDb_H

#include "AbstractDb.h"
#include <mutex>
class SqlDb : public AbstractDb {
    
public :

    SqlDb();
    
    virtual ~SqlDb();

    virtual bool isConnected() const;
    
    virtual bool isSane();
    
    virtual int query(const resip::Data& queryCommand) const = 0;
    
    virtual void setConnected(bool connected) const;
        
    const char* tableName(const AbstractDb::Table& table) const;
    
    bool dbEraseRecord(const Table table, const resip::Data& key, bool isSecondaryKey);

    mutable volatile bool _connected;		
    
    mutable std::mutex _mutex;
};

#endif//! WebSocketService_WSProtocol_SqlDb_H
